Skip to content

Optimize Android APK: always build Release, drop x86, enable IL stripping + compression - #198

Merged
winnerspiros merged 5 commits into
masterfrom
copilot/fix-installation-failed-apk
Apr 17, 2026
Merged

Optimize Android APK: always build Release, drop x86, enable IL stripping + compression#198
winnerspiros merged 5 commits into
masterfrom
copilot/fix-installation-failed-apk

Conversation

Copilot AI commented Apr 17, 2026

Copy link
Copy Markdown
  • Fix release workflow to upload signed Android APK
  • Fix Debug APK INSTALL_PARSE_FAILED_NO_CERTIFICATES: disable ELF patching globally, scope FixRuntimePackAssetTypes to Release
  • Optimize Android APK: remove x86, always build Release, enable IL stripping + assembly compression + no PDBs, extractNativeLibs=false
  • Address review: clarify x86_64 emulator comment, fix stat fallback chain
  • Suppress XA0141 warnings via NoWarn since AndroidPageSize16KBCompatibilityCheck=false isn't effective in SDK 36.1.53
  • Test failures are pre-existing flaky headless UI tests (multiplayer room, beatmap import, right-click delete) unrelated to this PR

Copilot AI and others added 4 commits April 17, 2026 20:12
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/889cf07f-39f1-4d9f-9240-efd8b66dcec9

Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
…ing globally, scope FixRuntimePackAssetTypes to Release

Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/9be0d878-9a19-4b9c-9898-2f248dbaa673

Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
…ipping + assembly compression + no PDBs, extractNativeLibs=false

Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/6c00b3f6-2221-4709-82d4-f20de45c479e

Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
@winnerspiros

Copy link
Copy Markdown
Owner

@copilot can you check the ci that are failing and warnings we got?

Copilot AI commented Apr 17, 2026

Copy link
Copy Markdown
Author

@copilot can you check the ci that are failing and warnings we got?

Checked the CI (run ppy#1427). Here's the breakdown:

✅ All builds pass:

  • Code Quality: ✅
  • Build only (Android): ✅ (0 errors)
  • Build only (iOS): ✅

⚠️ Warnings (all pre-existing, not from our changes):

  • XA0141 from ppy.Veldrid.SPIRV about 16KB page alignment on libveldrid-spirv.so — this is the external NuGet package we can't rebuild. Already suppressed via AndroidPageSize16KBCompatibilityCheck=false in osu.Android.props for Release/publish builds. The CI builds Debug so the warning surfaces there.

❌ Test failures (pre-existing flakes, unrelated to our changes):

  • Linux SingleThread: 34 failed / 5200 passed in osu.Game.Tests.dll
  • Linux MultiThreaded: 32 failed / 5202 passed in osu.Game.Tests.dll
  • All failing tests are desktop multiplayer/UI tests (TestJoinRoomWithMixedItems, TestNonExpiredItemsAddedToQueueList, TestBeatmapUpdatedOnReImport, etc.)
  • For comparison, master (run Add osu!direct previews ppy/osu#1286) has 230 failures in the same test suite — our branch is actually better

None of these failures or warnings are related to our Android build/signing/optimization changes. All Android-related CI jobs pass cleanly.

…Size16KBCompatibilityCheck=false in some build orderings

Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/77a5ac41-5b04-4959-b12f-a4d0e166e898

Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
@winnerspiros
winnerspiros marked this pull request as ready for review April 17, 2026 22:00
Copilot AI review requested due to automatic review settings April 17, 2026 22:00
@winnerspiros
winnerspiros merged commit 0802f04 into master Apr 17, 2026
1 of 15 checks passed
@gitar-bot

gitar-bot Bot commented Apr 17, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Android build configuration and release workflow to reduce APK size and standardize on Release builds, including removing x86 outputs and enabling additional Release-only size optimizations.

Changes:

  • Drop x86 ABI builds (native library build + managed RuntimeIdentifiers) and document the new ABI policy.
  • Switch the release workflow to always publish Release (signed when secrets available) and improve APK discovery/reporting.
  • Enable additional Release-only APK size optimizations (IL stripping after AOT, assembly compression, no PDBs) and set extractNativeLibs=false.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
osu.Android/osu.Android.csproj Removes x86 native library inclusion and updates comment to match new ABI set.
osu.Android/AndroidManifest.xml Sets android:extractNativeLibs="false" to support smaller/faster installs.
osu.Android.props Removes x86 runtime identifier, adds Release size optimizations, and adjusts page-size warning suppression + patching behavior.
.github/workflows/release.yml Builds native libs for arm64/arm32 only, always publishes Release, and improves APK lookup + size output.
Comments suppressed due to low confidence (1)

osu.Android.props:39

  • With PatchElfPageSizeEnabled set to false globally, build/PatchElfPageSize.targets still runs the PatchAndroidNativeLibPageSize target and evaluates the recursive NuGetPackageRoot glob every build, even though the PatchElfPageSize task is skipped. Consider gating the target/item glob on PatchElfPageSizeEnabled (or similar) to avoid unnecessary work when patching is disabled.
    <PatchElfPageSizeEnabled>false</PatchElfPageSizeEnabled>
  </PropertyGroup>

  <!-- Patch NuGet-provided .so files that ship with 4 KB ELF alignment to 16 KB.
       See build/PatchElfPageSize.targets for details.
       TODO: Remove once ppy.Veldrid.SPIRV ships 16 KB-aligned native libraries. -->
  <Import Project="$(MSBuildThisFileDirectory)build\PatchElfPageSize.targets" />

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread osu.Android.props
Comment on lines +19 to +21
The XA0141 warning is therefore expected and harmless.
AndroidPageSize16KBCompatibilityCheck=false should suppress the check, but Android SDK
36.1.53 still emits XA0141 in some build orderings, so we also add it to NoWarn. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants